#ifndef MATERIAL_H
#define MATERIAL_H

#include "common.h"
#include "color.h"
#include "vector3.h"

class Scene;

class Material
{
public:
	
	Material(Scene* scene)
	: scene(scene) {}
	
	// Returns color of surface at a particular point
	virtual Color shade(const Vector3& p, const Vector3& n,
		const Vector3& v) = 0;

protected:
	Scene* scene;
};	

class SimpleMaterial : public Material
{
public:
	SimpleMaterial(Scene* scene, const Color& color)
		: Material(scene), color(color) {}

	virtual Color shade(const Vector3& p, const Vector3& n,
		const Vector3& v);

private:
	Color color;
};

class DiffuseMaterial : public Material
{
public:
	DiffuseMaterial(Scene* scene, const Color& color)
		: Material(scene), color(color) {}
	
	virtual Color shade(const Vector3& p, const Vector3& n,
		const Vector3& v);

private:
	Color color;
};

class MirrorMaterial : public Material
{
public:
	MirrorMaterial(Scene* scene, const Color& color)
		: Material(scene), color(color) {}

	virtual Color shade(const Vector3& p, const Vector3& n,
		const Vector3& v);

private:
	Color color;
};

#endif
